Various types of image synthesis apparatus for synthesizing three-dimentional (3D) images are known in the art. An example of the configuration thereof is shown in FIG. 11. This prior-art example comprises a control section 510, a virtual 3D space computation section 520, an image supply section 530, and an image synthesis section 540. The virtual 3D space computation section 520 performs computations for creating a virtual 3D space on the basis of control information that is input from the control section 510. The image supply section 530 performs computations such as coordinate transformation and clipping to create an image as seen from any predetermined viewpoint within the thus created virtual 3D space. In this case, each of the display objects configuring this virtual 3D space is configured by polygons, and the image supply section 530 outputs information (such as vertex coordinates) for each of these polygons to the image synthesis section 540. The image synthesis section 540 performs processing for drawing all the dots (pixels) within each polygon, from the thus input polygon information, making it possible to show an image on a display 512.
During this type of drawing processing, if a polygon is found to overlap another polygon, it is usually necessary to remove the portion thereof that is further away from the viewpoint (the hidden surface) and display only that portion that is closer to the viewer. A known prior-art method of removing such hidden surfaces is called the Z-buffer method. An example of this Z-buffer method was disclosed in Jyouhou-Shori (Information Processing) Vol. 24, No. 4 (published by the Information Processing Society, Apr. 15, 1983).
In the prior-art image synthesis apparatus that is intended to perform this hidden surface removal by the Z-buffer method, the image synthesis section 540 comprises a drawing processing section 542 and a Z-buffer 544. In this case, the Z-buffer 544 is a memory containing storage areas corresponding to each of the pixels on the screen, and each storage area contains a Z-value which is depth information that expresses distance from a viewpoint.
The Z-buffer method will now be described with reference to FIGS. 12A and 12B. In FIG. 12A, polygons P and Q of 3D objects 300 and 301 are perspectively transformed on a screen 306. The drawing processing is performed with the aid of the Z-buffer 544, in the sequence shown in FIG. 12B. A maximum value M (which is usually an infinite value) of the Z-values has been written into the Z-buffer 544 as an initial value. When the polygon P is drawn, for example, a decision is made as to whether or not the Z-value of each pixel of the polygon P is less than the Z-value of the corresponding pixel stored in the Z-buffer 544. If it is determined to be smaller, that pixel is subjected to drawing processing by the drawing processing section 542 and the Z-value of that pixel in the Z-buffer 544 is modified. More specifically, all of the corresponding Z-values are updated from M to P1 to P12.
Similarly, when the polygon Q is drawn, the Z-buffer 544 is referenced for each of the pixels to be drawn, and the drawing processing and updating of the Z-buffer 544 are performed in sequence in the same manner as described above. More specifically, the values P7, P8, P11, and P12 are updated to Q1, Q2; Q5, and Q6, and the M values for the remaining part of the polygon Q are updated to Q3, Q4, Q7, and Q8 to Q12. In other words, since the polygon Q is closer than the polygon P in this particular case, the overlapping portion thereof overwrites the Z-values to those of the polygon Q. The drawing processing section 542 uses the above method for the drawing processing of each polygon, and thus obtained image information is output through a frame buffer 546 and palette circuit 548 to the display 512.
This type of image synthesis apparatus is usually required to perform its processing in real-time, making it necessary to update the image data for one screen image (or, in some cases, two screen images) once every field, which could be once every 1/60 second. Thus this image synthesis apparatus is required to provide high-speed processing and the image quality will deteriorate if it cannot maintain this high speed. The part of this apparatus that is particularly important in regulating the speed of this image processing is the part thereof that performs the drawing processing for the pixels.
However, the prior-art Z-buffer method forces the apparatus to go through the entire procedure of referencing the Z-buffer 544, comparing the Z-value with the Z-value stored in the Z-buffer, and writing the result of this comparison back into the Z-buffer for each of the pixels during the drawing processing. This Z-buffer usually has a huge capacity and is provided as external memory for the drawing processing device. Therefore, time is required for accessing this memory, and thus drawing processing that has to access this external memory for each of the pixels will increase the overall processing time. In consequence, a limit has to be placed on the number of polygons that can be processed within one field, obstructing the provision of a high-quality image.
Since the Z-buffer for this prior-art Z-buffer method is external memory, physical limitations such as the numbers of output pins of the drawing processing device make it difficult to connect a plurality of drawing processing devices to a single Z-buffer to implement parallel processing.
A method of drawing processing in which cache memory is used to temporarily store part of contents of the Z-buffer is disclosed in Japanese Patent Application Laid-Open No. 3-255589. However, the drawing processing provided by this method still has to be performed while the depth information stored in the cache memory is referenced for each of the pixels, and thus the problem of a too-long drawing processing time inevitably remains.
Other methods of increasing speed are known, such as using page mode when DRAM is used as the Z-buffer. However, it has not been possible to up until now to enable the prior-art Z-buffer method to make full use of the characteristics of these methods of increasing the processing speed.
This invention was devised in order to solve the above described technical problems in the prior art. An objective thereof is to improve on the prior-art Z-buffer method by providing a ZR-buffer in addition to the Z-buffer (main Z-buffer), in order to increase the processing speed of drawing.
Another objective of this invention is to improve on the Z-buffer method to implement a drawing processing method that is suitable for parallel processing.
A further objective of this invention is to improve on the Z-buffer method to allow the application of techniques such as using cache memory or page mode.